Add input-driven HMM classes where state transitions are conditioned on inputs - #452
Open
umeshksingla wants to merge 3 commits into
Open
Add input-driven HMM classes where state transitions are conditioned on inputs#452umeshksingla wants to merge 3 commits into
umeshksingla wants to merge 3 commits into
Conversation
_compute_initial_probs is called from two places: _inference_args() and _single_expected_log_like() in m_step. But _inference_args() passes the full input sequence to it, while _single_expected_log_like() passes only the first timestep's input (as retrieved from collect_suff_stats). StandardHMMInitialState never surfaces this, since its distribution() ignores inputs entirely. Fix by slicing inputs to the first timestep specifically for the initial component, leaving the transition/emission components' full-sequence inputs unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
InputDrivenLinearRegressionHMMandInputDrivenCategoricalRegressionHMMwhere the initial-state and transition distributions are multinomial logistic regressions on an inputu_t, on top of the existingLinearRegressionHMMEmissions/CategoricalRegressionHMMEmissions.Currently dynamax only supports input-dependence at the emission level (e.g.
LinearRegressionHMM,LogisticRegressionHMM). This PR extends it to the initial state and transitions and the two HMM classes added here can serve as examples of how to combine input-driven state transitions with other emission types.This wasn't on the help-wanted list, but there's been some interest in this (e.g., #344).
Also includes a fix for
_compute_initial_probsreceiving inconsistentinputsshapes in_inference_args()vs. the m-step (see that commit for details).